import request from '@/utils/request'

export function listUserResource(data) {
  return request({
    url: '/data/market/userResource/list',
    method: 'get',
    params: data
  })
}

export function pageUserResource(data) {
  return request({
    url: '/data/market/userResource/page',
    method: 'get',
    params: data
  })
}

export function getUserResource(id) {
  return request({
    url: '/data/market/userResource/' + id,
    method: 'get'
  })
}

export function addUserResource (data) {
  return request({
    url: '/data/market/userResource',
    method: 'post',
    data: data
  })
}


export function delDataApi(id) {
  return request({
    url: '/data/market/userResource/' + id,
    method: 'delete'
  })
}

export function updateUserResource(data) {
  return request({
    url: '/data/market/userResource/' + data.id,
    method: 'put',
    data: data
  })
}

export function downloadUserResource(data) {
  return request({
    url: '/data/console/sql/download',
    method: 'post',
    responseType: 'blob',
    headers: {
      'Content-Type': "application/json;charset=UTF-8"
    },
    data: data
  })
}


// 共享审批
export function applySubmit(id) {
  return request({
    url: '/data/market/userResource/'+id+'/applySubmit',
    method: 'post'
  })
}

export function getUserResourceDetail(id) {
  return request({
    url: '/data/market/userResource/detail/' + id,
    method: 'get'
  })
}
